
DELIMITER //
DROP TRIGGER delete_item_preference //
CREATE TRIGGER delete_item_preference AFTER DELETE ON sklad.items
 FOR EACH ROW
 BEGIN
  DELETE FROM sklad.preference WHERE item_id = OLD.item_id;
  DELETE FROM sklad.itemsAdvert WHERE item_id = OLD.item_id;
  DELETE FROM sklad.itemsMask WHERE item_id = OLD.item_id;
  DELETE FROM sklad.itemsDesc WHERE item_id = OLD.item_id;
  DELETE FROM sklad.itemsOnGoogle WHERE item_id = OLD.item_id;
 END //
DELIMITER ;
